IF (NOT CMAKE_BUILD_TYPE)
  SET (CMAKE_BUILD_TYPE Debug)
ENDIF ()

SET (CMAKE_CXX_FLAGS_DEBUG "${DEBUG_CXX_FLAGS} -D_WINSTATIC -DPOCO_STATIC -DHRTM_NO_AUTOMATIC_LINK")
SET (CMAKE_CXX_FLAGS_RELEASE "${RELEASE_CXX_FLAGS} -D_WINSTATIC -DPOCO_STATIC -DHRTM_NO_AUTOMATIC_LINK")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${RELWITHDEBINFO_CXX_FLAGS} -D_WINSTATIC -DPOCO_STATIC -DHRTM_NO_AUTOMATIC_LINK")
SET (CMAKE_CXX_FLAGS_MINSIZEREL "${MINSIZEREL_CXX_FLAGS} -D_WINSTATIC -DPOCO_STATIC -DHRTM_NO_AUTOMATIC_LINK")

IF (WIN32)
  SET (CMAKE_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:libcmtd /NODEFAULTLIB:libcpmtd")
  SET (CMAKE_EXE_LINKER_FLAGS_RELEASE "/NODEFAULTLIB:libcmt /NODEFAULTLIB:libcpmt")
  SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/NODEFAULTLIB:libcmtd /NODEFAULTLIB:libcpmtd")
  SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "/NODEFAULTLIB:libcmtd /NODEFAULTLIB:libcpmtd")
ENDIF ()

ADD_EXECUTABLE (
Fsm
Fsm.cc
FsmMain.cc
camera.cc
camera_functions.cc
)

TARGET_LINK_LIBRARIES (
Fsm
${VxMPTransport_LIBRARIES}
${HRTM_STATIC_LIBRARIES}
)

IF (VXWORKS)
  VW_TARGET_LINK_LIBRARIES (fsm_out)
  VW_LINK_OBJECTS (fsm_out Fsm)
ENDIF (VXWORKS)

EXECUTE_PROCESS (
COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_CURRENT_SOURCE_DIR}/rtc.conf
${CMAKE_CURRENT_BINARY_DIR}/rtc.conf
)

